package com;

import com.config.FactoryBeanConfig;
import com.config.MyConfig;
import com.entity.FactoryBeanEntity;
import com.entity.UserEntity;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Application {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(MyConfig.class);
//        UserEntity userEntity = applicationContext.getBean("com.entity.UserEntity", UserEntity.class);
//        System.out.println(userEntity);
        String[] beanDefinitionNames = applicationContext.getBeanDefinitionNames();
        for (int i = 0; i < beanDefinitionNames.length; i++) {
            System.out.println(beanDefinitionNames[i]);
        }
//        FactoryBeanEntity factoryBeanConfig = (FactoryBeanEntity)applicationContext.getBean("com.config.FactoryBeanConfig");
//        System.out.println(factoryBeanConfig);
    }
}
